#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include <stdlib.h>
//int main(int argc,char* argv[],char* env[])

extern char** environ;
int main()
{   
    
    size_t i = 0;
    for(i = 0;environ[i];i++)
    {
        printf("environ[%d]:%s\n",i,environ[i]);
    }
    
    
    
    ////test only I can use this program
    //char* val = getenv("USER");
    //if(val == NULL)
    //    return 1;
    //if(strcmp(val,"wxd") != 0)
    //{
    //    printf("you are not wxd!\n");
    //}
    //else 
    //{
    //    printf("程序执行\n");
    //}



    //char* value = getenv("PATH");
    //if(value == NULL)
    //    return 1;
    //printf("PATH->%s\n",value);
    
    
    
    
    
    
    
    
    
    
    //(void)argc;
    //(void)argv;

    //size_t i = 0;
    //while(env[i])
    //{
    //    printf("env[%d]:%s\n",i,env[i]);
    //    i++;
    //}
    //
    
    
    
    
    //f(argc < 2)
    //{
    //    printf("usage: %s [-a | -b | -c]\n",argv[0]);
    //    return 1;
    //}

    //if(strcmp(argv[1],"-a") == 0)
    //{
    //    printf("fun 1\n");
    //}
    //else if(strcmp(argv[1],"-b") == 0)
    //{

    //    printf("fun 2\n");
    //}
    //else if(strcmp(argv[1],"-c") == 0)
    //{
    //    printf("fun 3\n");
    //}
    //else
    //{
    //    printf("usage: %s [-a | -b | -c]\n",argv[0]);
    //}



    //printf("%d\n",argc);
    //size_t i = 0;
    //for(i = 0;i < argc;i++)
    //{
    //    printf("argv[%d]:%s\n",i,argv[i]);
    //}



    
    return 0;

}
